<template>
  <div class="menu">
    <el-row class="tac">
      <el-col :span="24">
        <el-menu
          active-text-color="#ffd04b"
          background-color="#545c64"
          class="el-menu-vertical-demo"
          default-active="/home"
          text-color="#fff"
          @open="handleOpen"
          @close="handleClose"
          :unique-opened="true"
          :router="true"
        >
          <el-menu-item index="/home">
            <el-icon><icon-menu /></el-icon>
            <span>系统首页</span>
          </el-menu-item>
          <el-sub-menu index="1">
            <template #title>
              <el-icon><location /></el-icon>
              <span>用户管理</span>
            </template>
            <el-menu-item index="/acounterList">用户列表</el-menu-item>
            <el-menu-item index="/updatePassword">修改密码</el-menu-item>
          </el-sub-menu>
          <el-sub-menu index="3">
            <template #title>
              <el-icon><location /></el-icon>
              <span>系统订单</span>
            </template>
            <el-menu-item index="/orderList">订单列表</el-menu-item>
          </el-sub-menu>
          <el-sub-menu index="4">
            <template #title>
              <el-icon><location /></el-icon>
              <span>车辆调度管理</span>
            </template>
            <el-menu-item index="/TrainList">列车基本信息管理</el-menu-item>
            <el-menu-item index="/trainTravelPlan"
              >列车行驶计划管理</el-menu-item
            >

            <el-menu-item index="/stationInfo">列车车站信息管理</el-menu-item>
          </el-sub-menu>
          <el-sub-menu index="5">
            <template #title>
              <el-icon><location /></el-icon>
              <span>操作日志</span>
            </template>

            <el-menu-item index="/logdetail">日志详情</el-menu-item>
          </el-sub-menu>
        </el-menu>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import {
  Document,
  Menu as IconMenu,
  Location,
  Setting,
} from "@element-plus/icons-vue";
export default {
  data() {
    return {
      role: "",
    };
  },
  methods: {
    handleOpen(key, keyPath) {
      console.log(key, keyPath);
    },
    handleClose(key, keyPath) {
      console.log(key, keyPath);
    },
  },

  // v-if="role == 1"
  // created() {
  //   let user = JSON.parse(localStorage.getItem("user"));
  //   this.role = user.role;
  // },
};
</script>

<style lang="scss" scoped>
.menu {
  width: 200px;
}
</style>
